package com.salesmanager.core.utils;

import com.salesmanager.core.business.content.model.FileContentType;

public class ImageFilePathUtils {

    private static final String STATIC_URI = "/zfl";

    /**
     * @param adCode
     * @param imageName
     * @return
     */
    public static String buildAdImageFilePath(String adCode, String imageName) {
        StringBuilder path = new StringBuilder();
        path.append(STATIC_URI).append("/").append("ads")
                .append("/").append(adCode)
                .append("/").append(imageName);
        return path.toString();
    }

    /**
     * 应用图片文件路径
     * @param appCode
     * @param imageName
     * @return
     */
    public static String buildAppImageFilePath(String appCode, String imageName) {
        StringBuilder path = new StringBuilder();
        path.append(STATIC_URI)
                .append("/").append(FileContentType.APP.name())
                .append("/").append(appCode)
                .append("/").append("img")
                .append("/").append(imageName);
        return path.toString();
    }


    /**
     * 应用安装包文件路径
     *
     * @param appCode
     * @param fileName
     * @return
     */
    public static String buildAppApKFilePath(String appCode, String fileName) {
        StringBuilder path = new StringBuilder();
        path.append(STATIC_URI)
                .append("/").append(FileContentType.APP.name())
                .append("/").append(appCode)
                .append("/").append("apk")
                .append("/").append(fileName);
        return path.toString();
    }


    /**
     * 安卓渠道包路径
     * @param channelCode
     * @param fileName
     * @return
     */
    public static String buildChannelApkFilePath(String channelCode,String fileName){
        StringBuilder path = new StringBuilder();
        path.append(STATIC_URI)
                .append("/").append(FileContentType.CHANNEL.name())
                .append("/").append(channelCode)
                .append("/").append(fileName);
        return path.toString();
    }

    /**
     *
     * @param code
     * @param imageName
     * @return
     */
    public static String buildMessageImageFilePath(String code,String imageName){
        StringBuilder path = new StringBuilder();
        path.append(STATIC_URI).append("/").append("DEFAULT")
                .append("/").append(FileContentType.MESSAGE_MANAGER.name())
                .append("/").append(code)
                .append("/").append(imageName);
        return path.toString();
    }
}
